<%@ page language="java" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%>

<%@ include file="/core/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<%@ include file="/core/adminMeta.jsp"%>
		 
		<!--框架必需end-->
		<script type="text/javascript">
			 
		 
			function check(){
				 
				showProgressBar();
				
				if ($("#loginName").val() == "") {
					alert("请输入用户名。");
					closeProgress();
					return false;
				}  
				
				if ($("#onePassword").val().length < 6) {
					alert("登陆密码不够六位");
					closeProgress();
					return false;
				}
				if ($("#onePasswordRec").val() != $("#onePassword").val()) {
					alert("两次一级密码不一样");
					closeProgress();
					return false;
				}
				if ($("#twoPassword").val().length < 6) {
					alert("安全密码不够六位");
					closeProgress();
					return false;
				}
				if ($("#twoPassword").val() != $("#twoPasswordRec").val()) {
					alert("两次安全密码不一样");
					closeProgress();
					return false;
				}
				
				if ($("#pwdAnswer").val() == "") {
					alert("请输入密保答案。");
					closeProgress();
					return false;
				}  
				 
				 
				return true;
			}
		</script> 
		<script type="text/javascript">
			 
			function recommendChange(){
				
				 
				var recommendLoginName=$("#recommendLoginName").val(); 		
				 
				$.getJSON("<%=basePath%>/admin/member/ajaxGetRecommendByName.shtml",{recommendLoginName: recommendLoginName},function(result){	 
					 
					//填入新值
					if(result.success==true){
						 
						$("#recommendPersonName").html("推荐人姓名:"+result.member.personName);
					}else{
						 
						$("#recommendPersonName").html("<b  style='color: red;'>推荐人不存在</b>");
					} 
				});
				
			}
			
			
			function fatherChange(){
				
				 
				var fatherLoginName=$("#fatherLoginName").val(); 		
				 
				$.getJSON("<%=basePath%>/admin/member/ajaxGetFatherByName.shtml",{fatherLoginName: fatherLoginName},function(result){	 
					 
					//填入新值
					if(result.success==true){
						
						$("#fatherPersonName").html("接点人姓名:"+result.member.personName);
					}else{
						 
						$("#fatherPersonName").html("<b  style='color: red;'>接点人不存在</b>");
					} 
				});
				
			}
			
			function centerChange(){
				
				 
				var centerLoginName=$("#centerLoginName").val(); 		
				 
				$.getJSON("<%=basePath%>/admin/member/ajaxGetCenterByName.shtml",{centerLoginName: centerLoginName},function(result){	 
					 
					//填入新值
					if(result.success==true){
						
						$("#centerPersonName").html("服务中心姓名:"+result.member.personName);
					}else{
						 
						$("#centerPersonName").html("<b  style='color: red;'>该会员不是服务中心</b>");
					} 
				});
				
			}
			 
			function loginNameChange(){
				
				var loginName=$("#loginName").val(); 	
				 
				$.getJSON("<%=basePath%>/admin/member/ajaxGetMemberByName.shtml",{loginName: loginName},function(result){	 
					//填入新值
					if(result.success==true){
						
						$("#loginNamePersonName").html("<b  style='color: blue;'>账号名可以用</b>");
					}else{
						$("#loginNamePersonName").html("<b  style='color: red;'>账号名已经存在</b>");
					}
					 
					
					 
				});
				 
				
			}
		</script> 
		
		<!-- 遮罩效果 -->
		 
		<!-- 遮罩效果结束 -->
	</head>

	<body>
		<div id="scrollContent">

			<div class="box2" panelTitle="注册会员" roller="true">

				<form id="commitForm" action="admin/member/memberAdd.shtml" method="post" onsubmit="return check()">
						<jodd:form scopes="request" beans="member">
						<table class="tableStyle"  >
							<tr>
								<th colspan="4" align="center">会员注册信息</th>
							</tr>					
												
							<tr>
								<td align="right" width="20%">
									会员编号：
								</td>
								<td align="left"  width="30%">
									<input type="text"  id="loginName" name="loginName"  onchange="loginNameChange()" />
									<span id="loginNamePersonName"></span> 
								</td>
								 
							  
								 
								<td align="right" width="20%">
									推荐人编号：
								</td>
								<td align="left"  >
									<input type="text" id="recommendLoginName" name="recommendLoginName"  onchange="recommendChange()"/>
									<span id="recommendPersonName"></span> 
								</td>
								
							</tr>
							
							 
							 
							<tr>
								<td align="right" width="20%">
									登陆密码：
								</td>
								<td align="left"  width="30%">
									<input type="password" id="onePassword" name="onePassword"   />
									 <span style="color: red">(*必填6位以上)</span>
									 
								</td>
							
								<td align="right" width="20%">
									确认登陆密码：
								</td>
								<td align="left"  width="30%">
									<input type="password" id="onePasswordRec"  
										name="onePasswordRec" />
									 <span style="color: red">(*必填6位以上)</span>
									 
								</td>
							</tr>
							<tr>
								<td align="right" width="20%">安全密码：</td>
								<td align="left"  width="30%">
								<input type="password" id="twoPassword" name="twoPassword" /> <span style="color: red">(*必填6位以上)</span></td>
							
								<td align="right"  width="20%">确认安全密码：</td>
								<td align="left"  width="30%"><input type="password" id="twoPasswordRec" name="twoPasswordRec" /> <span style="color: red">(*必填6位以上)</span></td>
							</tr>
							 
										
							<tr> 
							
								<td align="right" width="20%">手机号码：</td>
								<td align="left" width="30%">
									<input type="text"  id="tel" name="tel" /> 
								</td>
								<td  align="right" width="20%">姓名：</td>
								<td align="left" width="30%">
									<input type="text"  id="personName" name="personName" /> 
								</td>
							</tr>
							<tr> 
							
								<td align="right" width="20%">微信：</td>
								<td align="left" width="30%">
									<input type="text"  id="wei" name="wei" /> 
								</td>
								<td  align="right" width="20%">QQ：</td>
								<td align="left" width="30%">
									<input type="text"  id="qq" name="qq" /> 
								</td>
							</tr>
							 
							<tr>
								
								
								
								<td  colspan="4" style="text-align: center;">
									<input type="submit" value=" 提 交 " style="width: 80px;height: 30px;font-size: 17px;font-weight: bold;"/>
									<input type="reset" value=" 重 置 " style="width: 80px;height: 30px;font-size: 17px;font-weight: bold;"/>
								</td>
								 
							</tr>
												 
									
						</table>
				 		<div class="padding_top10">
					
							<table class="tableStyle" transMode="true">
								<tr>
									<td>
										<div style="color: red; text-align: center;">
											  ${retMsg}
										</div>
									</td>
								</tr>
							</table>
						
							
						</div>
						</jodd:form>
				</form>
			

			</div>
		</div>
		<!--代码高亮end-->
	</body>
</html>